package com.wyf.test.view

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
import android.widget.Toast

import com.wyf.test.R

class SecondActivity : AppCompatActivity() {

    private var textview: TextView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second)
        initView()
    }

    private fun initView() {
        textview = findViewById(R.id.tvMessage) as TextView?
        textview!!.text = "helloworld"
        textview!!.setOnClickListener {
            print("--------------------")
            startActivity(Intent(this@SecondActivity, MainActivity::class.java))
            Toast.makeText(this@SecondActivity, textview?.text, Toast.LENGTH_SHORT).show()
        }
    }
}
